# -*- coding: utf-8 -*-
from django.db import models


class Server(models.Model):
    s_name = models.CharField(verbose_name="服务器名称", max_length=8)
    ip = models.CharField(verbose_name="ip", max_length=32)
    create_time = models.DateTimeField("创建时间", null=True, blank=True, auto_now_add=True)
    update_time = models.DateTimeField("更新时间", null=True, blank=True, auto_now=True)
    owner = models.ForeignKey('auth.User', related_name='servers', on_delete=models.CASCADE)

    class Meta:
        db_table = "server"

    def __str__(self):
        return self.s_name

